package cn.sharetraffic.mi.etongdai;

/**
 * 功能：债权实体
 * 作者：蒋睿立
 * 时间：2017/7/20
 */
public class DebtEntity {

    /**
     * 还款期限
     */
    private Repay repay;

    /**
     * 还款方式
     */
    private RepayType repayType;

    /**
     * 进度
     */
    private double progress;

    /**
     * 预期年化收益率
     */
    private double rate;

    public RepayType getRepayType() {
        return repayType;
    }

    public void setRepayType(RepayType repayType) {
        this.repayType = repayType;
    }

    public double getProgress() {
        return progress;
    }

    public void setProgress(String progress) {
        this.progress = Double.parseDouble(progress);
    }

    public double getRate() {
        return rate;
    }

    public void setRate(String rate) {
        this.rate = Double.parseDouble(rate);
    }

    public Repay getRepay() {
        return repay;
    }

    public void setRepay(Repay repay) {
        this.repay = repay;
    }

    public enum RepayType {
        无(""),
        按月等额本息("1"),
        按月还息到期还本("2"),
        到期还本息("3"),;

        String type;

        RepayType(String type) {
            this.type = type;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }
    }

    public enum Repay {
        无(""),
        三十天("30"),
        六十天("60"),
        九十天("90"),
        三个月("3"),
        一百八十天("180"),
        六个月("6"),
        十二个月("12");

        String date;

        Repay(String rr) {
            this.date = rr;
        }

        public String getDate() {
            return date;
        }

    }

    @Override
    public String toString() {
        return "progress:"+this.progress+",rate:"+this.rate+",repay:"+
                this.repay+",repayType:"+this.repayType;
    }
}
